package com.ruoyi.sl.service.impl;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.ruoyi.sl.domain.SlRwork;
import com.ruoyi.sl.domain.SlWsMonthPay;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sl.mapper.SlRworkRmemberMapper;
import com.ruoyi.sl.domain.SlRworkRmember;
import com.ruoyi.sl.service.ISlRworkRmemberService;

/**
 * 操作人Service业务层处理
 * 
 * @author admin
 * @date 2024-06-07
 */
@Service
public class SlRworkRmemberServiceImpl implements ISlRworkRmemberService 
{
    @Autowired
    private SlRworkRmemberMapper slRworkRmemberMapper;

    /**
     * 查询操作人
     * 
     * @param rmemberId 操作人主键
     * @return 操作人
     */
    @Override
    public SlRworkRmember selectSlRworkRmemberByRmemberId(Long rmemberId)
    {
        return slRworkRmemberMapper.selectSlRworkRmemberByRmemberId(rmemberId);
    }

    /**
     * 根据报工单ID查询所有操作人
     *
     * @param rworkId 报工单ID
     * @return 操作人
     */
    @Override
    public List<SlRworkRmember> selectSlRworkRmemberListByRworkId(Long rworkId)
    {
        return slRworkRmemberMapper.selectSlRworkRmemberListByRworkId(rworkId);
    }

    /**
     * 根据报工人和日期查询所有操作人
     *
     * @param rwork 报工人和日期
     * @return 操作人
     */
    @Override
    public List<SlRworkRmember> selectSlRworkRmemberListByRwork(SlRwork rwork)
    {
        return slRworkRmemberMapper.selectSlRworkRmemberListByRwork(rwork);
    }

    /**
     * 查询操作人列表
     * 
     * @param slRworkRmember 操作人
     * @return 操作人
     */
    @Override
    public List<SlRworkRmember> selectSlRworkRmemberList(SlRworkRmember slRworkRmember)
    {
        return slRworkRmemberMapper.selectSlRworkRmemberList(slRworkRmember);
    }

    /**
     * 查询未提交报工项的操作人
     *
     * @param rwork
     * @return 操作人
     */
    @Override
    public List<SlRworkRmember> selectNotSlRworkRmemberList(SlRwork rwork){
        return slRworkRmemberMapper.selectNotSlRworkRmemberList(rwork);
    }

    /**
     * 根据报工单ID和人员查询总时长
     *
     * @param rfworkId 报工ID
     *   @param    rmemberUser 操作人
     * @return 结果
     */
    @Override
    public BigDecimal selectTotalDurationByRfworkIdAndUser(Long rfworkId,String rmemberUser){
        return slRworkRmemberMapper.selectTotalDurationByRfworkIdAndUser(rfworkId,rmemberUser);
    }

    /**
     * 根据人和日期查询指定出勤班组次数
     *
     * @return 结果
     */
    @Override
    public int selectBzCountByUserAndDate(Map map){
        return slRworkRmemberMapper.selectBzCountByUserAndDate(map);
    }

    /**
     * 新增操作人
     * 
     * @param slRworkRmember 操作人
     * @return 结果
     */
    @Override
    public int insertSlRworkRmember(SlRworkRmember slRworkRmember)
    {
        return slRworkRmemberMapper.insertSlRworkRmember(slRworkRmember);
    }

    /**
     * 修改操作人
     * 
     * @param slRworkRmember 操作人
     * @return 结果
     */
    @Override
    public int updateSlRworkRmember(SlRworkRmember slRworkRmember)
    {
        return slRworkRmemberMapper.updateSlRworkRmember(slRworkRmember);
    }

    /**
     * 批量删除操作人
     * 
     * @param rmemberIds 需要删除的操作人主键
     * @return 结果
     */
    @Override
    public int deleteSlRworkRmemberByRmemberIds(Long[] rmemberIds)
    {
        return slRworkRmemberMapper.deleteSlRworkRmemberByRmemberIds(rmemberIds);
    }

    /**
     * 删除操作人信息
     * 
     * @param rmemberId 操作人主键
     * @return 结果
     */
    @Override
    public int deleteSlRworkRmemberByRmemberId(Long rmemberId)
    {
        return slRworkRmemberMapper.deleteSlRworkRmemberByRmemberId(rmemberId);
    }

    /**
     * 根据报工单ID删除操作人信息
     *
     * @param rworkId 报工单ID
     * @return 结果
     */
    @Override
    public int deleteSlRworkRmemberByRworkId(Long rworkId)
    {
        return slRworkRmemberMapper.deleteSlRworkRmemberByRworkId(rworkId);
    }
}
